package entity;

public class TestOverLoad {
    /*
        override: 重写
        overload: 重载
     */

    /*
       加法
     */
    public void sum(int a,int b){
        System.out.println("整数");
        System.out.println(a+b);
    }
    public void sum(int a,double b){
        System.out.println("整数");
        System.out.println(a+b);
    }
    public void sum(double b,int a){
        System.out.println("整数");
        System.out.println(a+b);
    }


    public double sum(double a,double b){
        System.out.println("小数");
        System.out.println(a+b);
        return a+b;
    }


    public static void main(String[] args) {
        TestOverLoad test = new TestOverLoad();
        test.sum(1,2);
        test.sum(1.0,2);


    }
}
